package com.topone.service.impl;

import com.topone.dataObject.DynamicInfo;
import com.topone.dataObject.Mapper.DynamicMapper;
import com.topone.dto.DynamicDTO;
import com.topone.repository.DynamicInfoRepository;
import com.topone.service.DynamicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/1/21,0021.
 */
@Service
public class DynamicInfoServiceImpl implements DynamicInfoService {

    @Autowired
    private DynamicInfoRepository repository;
    @Autowired
    private DynamicMapper dynamicMapper;


    @Override
    public List<DynamicDTO> dynamicInfoList( DynamicDTO dynamicDTO) {
        return dynamicMapper.findListByStatus( dynamicDTO);
    }

    @Override
    public DynamicInfo findone(Integer status, String dynamicId) {
        return repository.findByStatusAndAndDynamicId(status,dynamicId);
    }

    @Override
    public void save(DynamicInfo dynamicInfo) {
        repository.save(dynamicInfo);
    }

    @Override
    public List<DynamicDTO> findDynamicByBussiness(DynamicDTO dynamicDTO) {
        return dynamicMapper.findDynamicByBussiness(dynamicDTO);
    }
}
